using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Configuration;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class RecruitManagement_Accounts : System.Web.UI.Page
{
    string connectionString =
    WebConfigurationManager.ConnectionStrings[
    "RCVDB2000"].ConnectionString;
    

    protected void Page_Load(object sender, EventArgs e)
    {
        SqlConnection sqlConnection;
        SqlCommand sqlCommand;
        sqlConnection = new SqlConnection();
        sqlConnection.ConnectionString =
        connectionString;
        try
        {
            sqlConnection.Open();
            sqlCommand = new SqlCommand();
            sqlCommand.CommandText =
            "select UserID, FirstName+"+
            " ' ' + LastName as FullName, "+
            " Address, City from tblJSAccounts";
            sqlCommand.Connection = sqlConnection;
            sqlCommand.CommandType = CommandType.Text;
            SqlDataAdapter sqlDataAdapter = 
            new SqlDataAdapter(sqlCommand);            
            DataTable dataTable = new DataTable();
            sqlDataAdapter.Fill(dataTable);
            GridView1.DataSource = dataTable;
            GridView1.DataBind();
            sqlCommand.Dispose();
            sqlDataAdapter.Dispose();
            sqlConnection.Close();
        }
        catch (Exception ex)
        {
            literalError.Text += "Failed:" + ex.Message;
        }
        sqlConnection.Dispose();
    }
     
}
